import csv


def read_csv_to_text(file_path):
    with open(file_path, "r", encoding="utf-8") as file:
        # 创建csv.reader对象，按行读取CSV的内容
        reader = csv.reader(file)
        # 对每一行，用逗号连接各列，生成字符串列表
        rows = [", ".join(row) for row in reader]
    all_text = "\n".join(rows)
    return all_text


# 主程序入口，进行测试调用
if __name__ == "__main__":
    # 调用函数，读取并打印example.json文件内容
    result = read_csv_to_text("example.csv")
    print(result)
